import React from 'react';

interface DeleteConfirmModalProps {
  isOpen: boolean;
  onClose: () => void;
  onConfirm: () => void;
  title?: string;
  itemName: string;
  message?: string;
  cancelText?: string;
  confirmText?: string;
  dangerMessage?: string;
}

const DeleteConfirmModal: React.FC<DeleteConfirmModalProps> = ({
  isOpen,
  onClose,
  onConfirm,
  title = '确认删除',
  itemName,
  message = '您确定要删除以下项目吗？',
  cancelText = '取消',
  confirmText = '确认删除',
  dangerMessage = '注意：此操作不可撤销，删除后数据将无法恢复。'
}) => {
  if (!isOpen) return null;

  return (
    <div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
      <div className="bg-white rounded-lg shadow-xl w-full max-w-md mx-4 p-6">
        <h2 className="text-xl font-medium text-slate-800 mb-4">{title}</h2>
        
        <div className="mb-6">
          <p className="text-slate-600">{message}</p>
          <p className="font-medium text-slate-800 mt-2">{itemName}</p>
          {dangerMessage && (
            <p className="text-red-600 text-sm mt-4">
              {dangerMessage}
            </p>
          )}
        </div>
        
        <div className="flex justify-end space-x-3">
          <button
            type="button"
            onClick={onClose}
            className="px-4 py-2 border border-slate-300 text-slate-700 rounded-md hover:bg-slate-50 min-h-[44px]"
          >
            {cancelText}
          </button>
          <button
            type="button"
            onClick={onConfirm}
            className="px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 min-h-[44px]"
          >
            {confirmText}
          </button>
        </div>
      </div>
    </div>
  );
};

export default DeleteConfirmModal;
